package com.laogao.service;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;

/**
 * @author laogao
 */
public interface SysFileService {
    /**
     * 通用文件上传(返回的文件别名)
     *
     * @param file
     * @param request
     * @return 文件url
     * @throws IOException
     */
    HashMap<String, Object> uploadFileNickName(MultipartFile file, HttpServletRequest request) throws IOException;

    /**
     * 上传文件显示文件原名
     *
     * @param file
     * @param request
     * @return
     * @throws IOException
     */
    HashMap<String, Object> uploadFileOriginalName(MultipartFile file, HttpServletRequest request) throws IOException;

    /**
     * 下载文件,ids为多个就以压缩包形式下载
     *
     * @param ids
     * @param response
     * @throws Exception
     */
    void download(List<Long> ids, HttpServletResponse response) throws Exception;

}